Function Reference

_StringInsert

Inserts a string within another string.

_StringInsert($s_String, $s_InsertString, $i_Position)

 

Parameters

$s_String Original string
$s_InsertString String to be inserted
$i_Position Position to insert string (negatives values count from right hand side)

 

Return Value

Success: Returns new modified string
Failure: Returns original string and sets the @error to the following values:
@error = 1 : Source string empty
@error = 2 : Insert string empty
@error = 3 : Invalid position

 

Remarks

Use negative position values to insert string from the right hand side.

 

Related

 

Example


#include<string.au3>
; Inserts three "moving" underscores and prints them to the console
For $i_loop = -20 To 20
    ConsoleWrite($i_loop & @TAB & _StringInsert ("Supercalifragilistic", "___", $i_loop) & @CR)
Next